(function turnplate_flow(params) {

    var token = locationSearcher('token');
    //抽奖商品渲染
    var expressListTpl = $('#expressList').html();
    var expressListCmp = Handlebars.compile(expressListTpl);
    var loading = dialog.loading();
    $.ajax({
        url: C.interface.giftExpress,
        type: 'POST', //GET
        data: {
            token: token
        },
        dataType: 'json',    //返回的数据格式：json/xml/html/script/jsonp/text
        complete:function () {
            loading.close();
        },
        success: function (data) {
            if (data.errorCode == '200'){
                var expressList = data.data;
                if (expressList.length == 0){
                    $('.none-wuliu').show();
                }else {
                    expressList.forEach(function(item, index){
                        item.result = JSON.parse(item.result);
                    });


                    $('#aui-slide').html(expressListCmp(expressList));
                    var slide = new auiSlide({
                        container: document.getElementById("aui-slide"),
                        "width":375,
                        "height": 550,
                        "speed": 300,
                        "pageShow": true,
                        "pageStyle": 'dot',
                        "loop": false,
                        'dotPosition': 'center'
                    })
                }
            }else {
                dialog.tusiError(data.errorMsg);
            }



        },
        error: function (response) {
            dialog.tusiError(response.errorMsg);
        }
    });

    Handlebars.registerHelper('changeTime',function (val) {
        var result = val.substring(5,val.length-3);
        return result;
    })
})();